﻿<%@ Page Title="Manage Stock Transfer" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="manage_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
        <h2>Stock Transfer List</h2>
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" DataKeyNames="str_key" DataSourceID="SqlSTRParent" ForeColor="#333333" GridLines="None">
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            <Columns>
                <asp:CommandField ShowSelectButton="True" ShowEditButton="True" />
                <asp:BoundField DataField="str_key" HeaderText="str_key" InsertVisible="False" ReadOnly="True" SortExpression="str_key" Visible="False" />
                <asp:BoundField DataField="str_no" HeaderText="STR NO" SortExpression="str_no" />
                <asp:BoundField DataField="company" HeaderText="Company" SortExpression="company" />
                <asp:BoundField DataField="date_filed" HeaderText="Date" SortExpression="date_filed" />
                <asp:BoundField DataField="transfer_from" HeaderText="From" SortExpression="transfer_from" />
                <asp:BoundField DataField="transfer_to" HeaderText="To" SortExpression="transfer_to" />
                <asp:BoundField DataField="prepared_by" HeaderText="Prepared By" SortExpression="prepared_by" />
                <asp:BoundField DataField="approved_by" HeaderText="Approved By" SortExpression="approved_by" />
                <asp:BoundField DataField="recieved_by" HeaderText="Recieved By" SortExpression="recieved_by" />
                <asp:BoundField DataField="time_stamp" HeaderText="Upload Date" SortExpression="time_stamp" />
                <asp:BoundField DataField="uploaded_by" HeaderText="Uploaded By" SortExpression="uploaded_by" />
            </Columns>
            <EditRowStyle BackColor="#999999" />
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#E9E7E2" />
            <SortedAscendingHeaderStyle BackColor="#506C8C" />
            <SortedDescendingCellStyle BackColor="#FFFDF8" />
            <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
        </asp:GridView>
       <h3> Items </h3>
    <p>
        <asp:GridView ID="GridView2" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" DataKeyNames="str_item_key" DataSourceID="SqlSTRItem" ForeColor="#333333" GridLines="None" CssClass="CSSTable">
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            <Columns>
                <asp:BoundField DataField="str_item_key" HeaderText="str_item_key" InsertVisible="False" ReadOnly="True" SortExpression="str_item_key" Visible="False" />
                <asp:BoundField DataField="str_no" HeaderText="str_no" SortExpression="str_no" Visible="False" />
                <asp:BoundField DataField="qty" HeaderText="QTY" SortExpression="qty" />
                <asp:BoundField DataField="unit" HeaderText="Unit" SortExpression="unit" />
                <asp:BoundField DataField="sku" HeaderText="SKU" SortExpression="sku" />
                <asp:BoundField DataField="description" HeaderText="Description" SortExpression="description" />
                <asp:BoundField DataField="unit_price" HeaderText="Unit Price" SortExpression="unit_price" />
                <asp:BoundField DataField="total" HeaderText="Total" SortExpression="total" />
                <asp:BoundField DataField="time_stamp" HeaderText="time_stamp" SortExpression="time_stamp" Visible="False" />
            </Columns>
            <EditRowStyle BackColor="#999999" />
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#E9E7E2" />
            <SortedAscendingHeaderStyle BackColor="#506C8C" />
            <SortedDescendingCellStyle BackColor="#FFFDF8" />
            <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
        </asp:GridView>
        <br />
        <br />
    </p>
    <p>
        <asp:SqlDataSource ID="SqlSTRParent" runat="server" ConnectionString="<%$ ConnectionStrings:Management_Info_SysConnectionString %>" DeleteCommand="DELETE FROM [str_parents] WHERE [str_key] = @str_key" InsertCommand="INSERT INTO [str_parents] ([str_no], [company], [date_filed], [transfer_from], [transfer_to], [prepared_by], [approved_by], [recieved_by], [time_stamp], [uploaded_by]) VALUES (@str_no, @company, @date_filed, @transfer_from, @transfer_to, @prepared_by, @approved_by, @recieved_by, @time_stamp, @uploaded_by)" SelectCommand="SELECT * FROM [str_parents]" UpdateCommand="UPDATE [str_parents] SET [str_no] = @str_no, [company] = @company, [date_filed] = @date_filed, [transfer_from] = @transfer_from, [transfer_to] = @transfer_to, [prepared_by] = @prepared_by, [approved_by] = @approved_by, [recieved_by] = @recieved_by, [time_stamp] = @time_stamp, [uploaded_by] = @uploaded_by WHERE [str_key] = @str_key">
            <DeleteParameters>
                <asp:Parameter Name="str_key" Type="Int64" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="str_no" Type="Int64" />
                <asp:Parameter Name="company" Type="String" />
                <asp:Parameter Name="date_filed" Type="String" />
                <asp:Parameter Name="transfer_from" Type="String" />
                <asp:Parameter Name="transfer_to" Type="String" />
                <asp:Parameter Name="prepared_by" Type="String" />
                <asp:Parameter Name="approved_by" Type="String" />
                <asp:Parameter Name="recieved_by" Type="String" />
                <asp:Parameter Name="time_stamp" Type="String" />
                <asp:Parameter Name="uploaded_by" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="str_no" Type="Int64" />
                <asp:Parameter Name="company" Type="String" />
                <asp:Parameter Name="date_filed" Type="String" />
                <asp:Parameter Name="transfer_from" Type="String" />
                <asp:Parameter Name="transfer_to" Type="String" />
                <asp:Parameter Name="prepared_by" Type="String" />
                <asp:Parameter Name="approved_by" Type="String" />
                <asp:Parameter Name="recieved_by" Type="String" />
                <asp:Parameter Name="time_stamp" Type="String" />
                <asp:Parameter Name="uploaded_by" Type="String" />
                <asp:Parameter Name="str_key" Type="Int64" />
            </UpdateParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlSTRItem" runat="server" ConnectionString="<%$ ConnectionStrings:Management_Info_SysConnectionString %>" SelectCommand="SELECT * FROM [str_items_] WHERE ([str_no] = @str_no)">
            <SelectParameters>
                <asp:SessionParameter Name="str_no" SessionField="SelectedParent" Type="Int64" />
            </SelectParameters>
        </asp:SqlDataSource>
    </p>
</asp:Content>

